Charles Builds Stuff


2018-07-31 Remote controlled tank, part 4: Crunch.

The perks of living with a guy who owns a 3D printer

I moved back to Markham for a co-op position at Flex Automotive Solutions in May.

A few weeks before the term was set to start, and well before the last update, I found a place to live. I sublet a basement apartment from a chemical engineer, Ed. Ed owns a 3D printer.

On the RC tank project, I was stuck on the pain point of getting the rubber to meet the road. I had the CAD, but I didn't actually have access to tools. Returning to my methods for the brushless motor project of years past, I went to 3D Systems QuickParts and got a quote for getting everything made properly. $2000 for all the drive train components in CNC aluminum seemed a little much for my budget, and set the project on mothballs while I ruminated on the predicament.

A few weeks into life in Markham, round two, I asked if I could use his 3D printer to prototype a few parts.

"Sure," he said, "if you pay for the filament."

Well, okay then. But that wasn't the key problem.


The pressing issue was now not how to build the bearing blocks, splines, and bushings. The question was how to make a shaft.

I already owned eight 608 ball bearings that seemed to be in the right size range for the task, but getting any part machined down to 8mm without access to tools of my own would be prohibitively expensive. So I settled on M8x1.25 threaded rod as the axle material.

However, nobody in Canada sells materials. And McMaster-Carr refuses to ship to Canadian individuals, much to my despair. So I had to look around, and really dig deep. I eventually found Wurth Canada, who would gladly send me two metres of M8 threaded rod and a bag of nuts for a reasonable price at a reasonable speed.

The day they arrived, I threw a pile of STL files at Ed, and beseeched him to get them rolling.

An hour later, I was greeted by the cutest spline to ever leave a print bed before my eyes.

And by some miracle, it fit in the sprocket. (First take, first try!)

Despite that, it did not fit on the 8mm threaded rod. Can't win them all.

By the end of the evening, I had assembled a full half axle. By the end of the next day, I had assembled half of the drive train.

The astute among you will note that the chain is not just loose, but floppy. This is not an ideal state of being for something that is supposed to get whipped about at tens of kilometres an hour. With that risk in mind, I gently tried to spin up the motor anyways. More of a coaxing than a flooring.

And it spun. It spun aggressively, violently, and for a very short span of time before throwing the chain.

So I printed out 1cm spacers for the bearing blocks.

With 1cm spacers, the slack in the chain was reasonable, but not acceptable.

Undeterred, I resized the chain extension by -16mm the next day, and then went back and tried again.

It turned out the chain was not quite 16mm loose. It was 8mm loose, putting the freshly resized chain at 8mm too short. But roller chain can't be an odd number of links long. So I printed out some 5mm spacers instead and swapped them in. The chain, without tensioners or springs, was now perfectly tight.

While I had been at work that day, Ed had travelled to the local library makerspace and got the PCB mount laser cut from fluorescent green acrylic. I did not know such a material was easily acquired. It is now my favorite laser-cutting material. While the 5mm spacers printed, I glued the standoffs into place, and mounted the XBee and motor controller. Then I added in the spacers, and managed to get everything assembled on the one side of the tank.

Heart (and 500W motor...) held in my hands, I connected the radio, set everything running, and tapped the throttle.

And experienced a feeling of elation known to all hobbyists who've been working on something ridiculous for eight months.


So, with the wheels spinning and everything looking mostly alright, I went ahead and set about printing the other drivetrain. A day later, everything was ready for action.

First test run!

I had the wherewithal to get a video of the first ever high speed test. Unfortunately, it was not a great video since I was holding the camera in my non-PS3 hand, and the right chain was thrown.


I set the machine on the ground, conected the battery, and started the software on my laptop, and it just... worked!


I know, right?


Crunch

At least, it did for the first ten minutes.

I had set up the control software on my laptop to read a wireless joystick (a PS3 controller) and pass it to the tank over XBee. The range on the XBee is about 2 km in open air.

With that optimistic number in mind, I had failed to consider the range of the PS3 controller - Bluetooth, ~100ft. So, while driving the robot around and trying to get it to do a 3-point turn on the street, I walked outside of the range of the controller in my hands. The laptop did not notice the sudden loss of connection, and kept sending the 50% throttle, 100% right instructions that I had been sending when I'd last had control.

This sent the robot flying towards and over the curb of a house down the street, and slamming in to the little brick wall around their garden.


Pop goes the bearing blocks.

As I said earlier, craaaaaaaaaaaaaaap.

This put an end to the excitement for the day. I set another set of bearing blocks printing, and went to bed.


Two steps forward, and one crooked floor lamp

The next night, after a whole bunch of failed prints, I improvised a solution to the electrical design problems that prevented proper reverse operation.

The problem, as previously described, is that I only had PWM on the negative side of the H-bridge. This meant that PWM would cause the motor to, in forward, toggle between accelerating and coasting, whereas in reverse it would toggle between accelerating and braking. By extension, this made turning the robot in place almost impossible.

I jumpered from the test points on the A+ and B+ lines to the other PWM pins on the board (B1 and FanCont), and reprogrammed the board.

Sadly, I made a connection mistake when placing the jumpers on the test points, so the robot immediately fired up it's motors at full reverse on boot and launched itself at my apartment wall, bending the floor lamp that was so bold as to stand in its way in the process.

The bearing blocks diametrically opposite to the first broken pair (rear-right half axle) both tore off in the crash, and the associated axle was bent in the crash - unsurprisingly

After getting my heart rate back to a normal level and cleaning the (truly impressive, I should add) skid marks off of the floor, I came back, checked my software, disconnected the quick-connect tab for the left motor, removed the chain from the right motor, along with the viscera of the destroyed half-axle, and propped the machine up with my legs to ensure that the functioning right motor couldn't do anything wrong.


With the benefit of hindsight, there's a rather clear mistake in my process here.

The quick-connect terminal swung around and made contact with the exposed tab of a MOSFET, connecting to the H-bridge exactly where it was originally intended to.


This left the energized side connected to the wheels, and in contact with my knee.


And since my software changes had not fixed the wiring mistake I had made (d'uh?), this left the 500W motor spinning up while the tire was pressed against my leg.


By the time I had cleaned the rubber out of my lower thigh and ankle, I had noticed that the wires were in the wrong spot. After groaning inwards, I fixed the problem. This time, I removed both chains entirely, replaced the now thoroughly charred quick connect tab on the motor, and fired it up.

And it worked without issue.


Bearing blocks killed: 4, and counting!

The next day - at time of writing, today - I rebuilt the machine with the freshly printed bearings, wrote a bit of code to detect loss of controller signal, and dragged the rig outside.

And moments before I was about to take my phone out to get a video, I plugged the battery in. Let's take a step back for a moment:


I had mentioned to Ed thirty minutes prior that the newly printed parts looked a little "airy" along the sides. The outermost layers had not fused correctly, we reckoned. The printer has some trouble with keeping up 195°C, so we had reduced the temperature to 185°C. We assumed this was solely a cosmetic issue, and moved along.


The start-up-chirp of the motor controller still sends full torque to the motors, if only for a few milliseconds. Full torque, combined with a bit of tension from the chain itself, resulted in the screw holes in the innermost rear right bearing block tearing out. This lead to the axle pivoting 45 degrees, putting the other bearing block in torsion. This third crunching noise found the rear axle underneath the front axle, and me laughing really hard once the boot confirmation had stopped and I was sure nobody was about to die.


Kill count: 6 bearing blocks


Where do we go now?

The new bearing blocks are printing as I write this. If all goes according to plan, tomorrow I'll have it all working. Stay tuned.